The other day I got really tired of bashpodder.shell. While it is a great and simple solution, it has quite a few limitations, namely podcasts were completely separate from my regular feeds.
I like automation, I particularly like automation that I can ignore. I have been using rss2email for a while. I even hacked it to post directly to one of my imap accounts instead of bothering to go through smtp. This has worked out exceptionally well.
My latest hack on rss2email is for it to recognize enclosures (the part of rss that makes it a ‘podcast’). Its quite simple right now. You specify the directory to download to, it makes a subdir based on the feed title, and uses a configured command to download it. Like I said, quick and dirty.
An example config.py
USE_IMAP=1
IMAP_USER=”username”
IMAP_HOST=”imap.example.com”
IMAP_PWD=”password”
IMAP_ROOT=”INBOX.feeds”
IMAP_DIRS=1
USE_PODCAST=1
PODCAST_DIR=”/home/user/podcasts”
PODCAST_DFLT_ARG=”-O %f %u”
PODCAST_DFLT_CMD=”wget”
PODCAST_DFLT_WAIT=False
#tuple is:
PODCAST_TYPES={‘application/x-bittorrent’: {‘default’:True,
‘m3u’:False,
‘m3uregex’: (“.torrent”,”"),
‘cmd’:”ctorrent”,
‘args’:” %u”,
‘wait’:True}}
The %f is replaced with the filetype part of the url. The %u is replaced with the url from the enclosure. The args are regex’d and then spawnpve is called. The WAIT variable will determine whether spawn will block or not.
An m3u file is generated at PODCAST_DIR/year-month-day.m3u .
One thing I would eventually like to do is make the config a bit more reasonable. Mainly the PODCAST_TYPES is hairy and not really functional. The m3u file is hardcoded, which should not be.
UPDATE:
Oh yeah… how about a link to the hacked rss2email? You can find it at http://blogs.openaether.org/data/rss2email.py